package untils

import (
	"log"
	"math/rand"
)

func PayMoney(carType string) float64 {
	km := rand.Intn(20)
	parse := km * 3.0
	rate := 1.0
	price := 0.0
	switch carType {
	case "快车":
		price = 2
		rate += 1.0

	case "豪华车":
		price = 4
		rate += 1.5

	case "商务":
		price = 8
		rate += 2.0
	}
	log.Println("公里", km, "价格", price, "倍率", rate)
	return rate * (price + float64(parse))
}
